<meta charset="UTF-8">
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 15-1-21
 * Time: 下午3:42
 */


include_once 'db.php';



if(@$_POST['json']){
            @$postdata=json_decode($_POST['json'],true);
    $action=$postdata['action'];
}else{
    echo 'post过来的数据！！！';
}

//$action =isset($_POST["action"]) ?$_POST["action"]:"";

//echo $_GET["action"];

if(empty($action)){
    $output = array('data'=>NULL, 'info'=>'坑爹啊!', 'code'=>-201);
    exit(json_encode($output));
}

$connect=Db::getInstance()->connect();

switch($action){
    case "productshow" :




if(@$_POST['json']){
    @$postdata=json_decode($_POST['json'],true);

    $id=$postdata['id'];




}else{
    echo 'post过来的数据！！！';
}

        $sql="select * from gnet_protaocan where proid='".$id."'";
        $result=mysqli_query($connect,$sql);
//$data=mysqli_num_rows($result);
//var_dump($data);
        $list=array();
        while( $data=mysqli_fetch_assoc($result)){
            $list[]=$data;
        }

//        print_r($list);
        echo json_encode($list);



    break;
    default:
        echo 'ss啥也没有';
}






